import wordcloud
import jieba
import imageio

mk=imageio.imread("woman1.png")
w = wordcloud.WordCloud(mask=mk)
w = wordcloud.WordCloud(
width=1000,
    height = 700,
    background_color = 'white',
    font_path = 'msyh.ttc',
    mask = mk,
    scale = 15,
    contour_width=2,
    contour_color='steelblue')

f = open('wwqy.txt', encoding='utf-8')
txt = f.read()
txtlist = jieba.lcut(txt)
string = " ".join(txtlist)

w.generate(string)

w.to_ﬁle('lunkuo.png')